
import api from "./api";
import { MyHttps } from "../utils/utils";
import exp from "constants";


export async function ProjectAddReq(params) {
    return MyHttps.post(api.project.add(), params);
}

export async function ProjectListReq(params) {
    return MyHttps.post(api.project.list(), params);
}

export async function ProjectGetReq(params:{id:number}) {
    return MyHttps.get(api.project.get(params.id));
}

export async function ProjectGroupAddReq(params) {
    return MyHttps.post(api.project.groupAdd() , params);
}

export async function ProjectGroupListReq(params) {
    return MyHttps.get(api.project.groupList(),params)
}

export async function ProjectGroupUpdReq(params) {
    return MyHttps.post(api.project.groupUpd(params.id),params)
}

export async function ProjectGroupJoinReq(params) {
    return MyHttps.post(api.project.groupJoin(params.id),params)
}

export async function ProjectGroupDelReq(params) {
    return MyHttps.get(api.project.groupDel(params.id),params)
}

export async function ProjectGroupGetReq(params) {
    return MyHttps.get(api.project.groupGet(params.id),params)
}

export async function GetProjectUsersReq(params){
    return MyHttps.get(api.project.userList(),params)
}

export async function ProjectUpdReq(params) {
    return MyHttps.post(api.project.upd(),params)
}

export async function ProjectInviteReq(params:{uid:number}) {
    return MyHttps.post(api.project.invite(),params)
}

export async function ProjectJoinReq(params:{pid:number}) {
    return MyHttps.post(api.project.join(params.pid),params)
}

export async function GetInviteDataReq(params:{pid:number}) {
    return MyHttps.get(api.project.inviteData(params.pid),params)
}

export async function DeleteProjectReq(params:{pid:number}) {
    return MyHttps.post(api.project.delete(params.pid),{})
}

export async function GetProjectReportDataReq(params:{pid:number}) {
    return MyHttps.get(api.project.getReportData(params.pid),{})
}

export async function QuitProjectReq(params:{pid:number}) {
    return MyHttps.get(api.project.quit(params.pid),{})
}

export async function ProjectTransferReq(params:{pid:number,uid:number}) {
    return MyHttps.post(api.project.transfer(params.pid),params)
}

export async function DelProjectUsers(params:{userIds:number[],pid:number}) {
    return MyHttps.post(api.project.deleteUsers(),params)
}   